﻿using ALinq.Mapping;

namespace ALinq.Web.Security
{
    partial class MembershipDataContext
    {
        //public const string DefaultPathName = "C:/Membership.db";

        //public MembershipContext(string conn)
        //    : base(conn, CreateMapping())
        //{

        //}

        //public MembershipContext()
        //    : base(WebConfigurationManager.ConnectionStrings["ALinqMembership"].ConnectionString, CreateMapping())
        //{

        //}

        private static MappingSource CreateMapping()
        {
            var xmlMapping = XmlMappingSource.FromStream(typeof(MembershipDataContext).Assembly.GetManifestResourceStream("ALinq.Web.Security.MembershipContext.designer.map"));
            return xmlMapping;
        }

        public MembershipDataContext(MappingSource mappingSource) :
            base(Properties.Settings.Default.ALinqMembershipConnectionString, mappingSource)
        {
            OnCreated();
        }

    }
}